package com.weg.ide.common;

import static android.os.Build.SUPPORTED_ABIS;
import static java.util.Arrays.stream;

/**
 * @project: JvIDE
 * @author: WEG
 * @description: 不需要使用该类
 **/
public final class Arch {

    public static boolean isArm64() {
        return stream(SUPPORTED_ABIS).allMatch("arm64-v8a"::equals);
    }

    public static boolean isArmPie() {
        return stream(SUPPORTED_ABIS).allMatch("armeabi-v7a"::equals);
    }

    public static boolean isX86() {
        return stream(SUPPORTED_ABIS).allMatch("x86"::equals);
    }

    public static boolean isX86Pie() {
        return stream(SUPPORTED_ABIS).allMatch("x86_x64"::equals);
    }

    public static String getArch() {
        if (isArm64())
            return "arm64-v8a";
         else if (isArmPie())
            return "armeabi-v7a";
         else if (isX86())
            return "x86";
         else if (isX86Pie())
            return "x86_x64";
         else
            return "UNKNOWN";
    }

}
